<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>{BEESCRM:$title}</title>
    <meta name="description" content="">
    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui, user-scalable=no">
    <meta http-equiv="cleartype" content="on">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/assets/base/busbooking/css/style.css">
    <link rel="stylesheet" href="/assets/base/busbooking/css/layer.css">
</head>
<body>
<div class="wraper">
    <div class="header ">
        <a href="javascript:history.go(-1)" class="iconfont icon-llmainpageback back"></a>

        <div class="title text-center font-16">购票</div>
    </div>
    <div class="address text-center">
        <div class="time font-12">
            {BEESCRM:$time}
        </div>
        <div class="flex-between Campus font-16">
            <div>{BEESCRM:$bus['start_address']}</div>
            <div class="arrows"><img src="/assets/base/busbooking/images/jiantou.png" alt=""></div>
            <div>{BEESCRM:$bus['end_address']}</div>
        </div>
        <p class="font-12 gray2">乘车地点：{BEESCRM:$bus['ride_address']}</p>
    </div>
    <div class="content">
        <volist name="businfo" id="vo">
            <div class="list flex-between">
                <div class="left">
                    <p class="gray2">{BEESCRM:$vo.departure_time}开</p>

                    <p class="gray font-12">
                        {BEESCRM:$vo.type_name}
                    </p>
                </div>
                <div class="right">
                    <p class="font-16 money text-right">{BEESCRM:$vo.price}</p>

                    <div class="buy" data-class_id="{BEESCRM:$vo.class_id}" data-price="{BEESCRM:$vo.price}">购票</div>
                </div>
            </div>
        </volist>
    </div>

</div>
</body>
<script src="/assets/base/busbooking/js/jquery-2.1.0.min.js"></script>
<script src="/assets/base/busbooking/js/layer.js"></script>
<script src="/assets/base/busbooking/js/public.js"></script>
<script>
    var height = $(window).height();
    $('.wraper').css('minHeight', height);

    $('.buy').click(function(){
        var class_id=$(this).data('class_id');
        var price = $(this).data('price');
        var info={};
        info.class_id=class_id;
        info.price = price;
        $.ajax({
            url:'/Base/BusBooking/createOrder/apply_id/{BEESCRM:$apply_id}/time/{BEESCRM:$time}',
            data: info,
            dataType: 'json',
            async:false,
            type: 'post',
            success: function (data) {
                if (data.status == 'S') {
                    location.href = data.url;
                } else {
                    fm.alert(data.message);
                }
            },
        });
        return false;
    //    window.location.href = "/Base/BusBooking/affirmBuy/apply_id/{BEESCRM:$apply_id}/time/{BEESCRM:$time}/class_id/"+class_id;

    })

</script>
</html>